package com.example.esp8266.Library.RoomLib.Dao_Interface;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.esp8266.Library.RoomLib.TaskDetail;

import java.util.List;

@Dao
public interface TaskDetailDao {
    @Insert
    void insert(TaskDetail taskDetail);

    @Update
    void update(TaskDetail taskDetail);

    @Delete
    void delete(TaskDetail taskDetail);

    @Query("SELECT * FROM task_detail WHERE taskId = :taskId")
    List<TaskDetail> getTaskDetailsByTaskId(int taskId);

    @Query("DELETE FROM task_detail")
    void deleteAll();  // 删除所有记录的方法

}